﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ScrumTime.Models;
using System.Web.Security;

namespace ScrumTime.ViewModels
{
    public class UserViewModel
    {

        private List<UserInfo> _users;

        public UserViewModel() {
            _users = new List<UserInfo>();
            FillUsers();
        }

        private void FillUsers() {
            AccountMembershipService membershipService = new AccountMembershipService();
            MembershipUserCollection membershipUserCollection = membershipService.GetAllUsers();
            foreach (MembershipUser user in membershipUserCollection)
            {
                _users.Add(new UserInfo(null, user));
            }
        }


        public List<UserInfo> Users {
            get {              
                return this._users;
            }
        }
    }
}